package deom2;

public class TestMyBinaryTree {
    public static void main(String[] args) {
        MyTree tree = new MyTree();
        tree.createBinaryTree();
        MyTree.BTNode root = tree.getRoot();
        System.out.println("前序打印:");
        tree.preOrder(root);
        System.out.println();
        System.out.println("中序打印:");
        tree.inOrder(root);
        System.out.println();
        System.out.println("后序打印:");
        tree.postOrder(root);
        System.out.println();

        tree.getnodeSize1(root);
        int nodeSize = tree.nodeSize;
        System.out.println("节点个数:");
        System.out.println(nodeSize);
        System.out.println(tree.getnodeSize2(root));

        System.out.println("叶子节点的个数:");
        tree.getLeafNodeSize1(root);
        int leafNodeSize = tree.leafNodeSize;
        System.out.println(leafNodeSize);
        System.out.println(tree.getLeafNodeSize2(root));

        System.out.println("获取第 3 层的节点个数");
        System.out.println(tree.getLevelNodeSize(root,3));

        System.out.println("数的高度");
        System.out.println(tree.getTreeHeight(root));
    }
}
